package com.example.tpmenu;


import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		menu.getItem(0).getSubMenu().setHeaderIcon(R.drawable.ic_launcher);	
		return true; }
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
	switch(item.getItemId()){
    case R.id.option:	
		Toast.makeText(getBaseContext(), "Option", Toast.LENGTH_SHORT).show();
		return true;
	case R.id.message:	
		Toast.makeText(getBaseContext(), "Message", Toast.LENGTH_SHORT).show();
		return true;	
	case R.id.profil:
		Toast.makeText(getBaseContext(), "Profile", Toast.LENGTH_SHORT).show();
		return true;
	case R.id.action_settings:
		Toast.makeText(getBaseContext(), "Settings", Toast.LENGTH_SHORT).show();	
		return true;	
	case R.id.quitter:
		Toast.makeText(getBaseContext(), "Quitter", Toast.LENGTH_SHORT).show();		
		return true;
	}		
		return false;
	}

}
